home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 4.00 Begin VB.Form ItemProp BorderStyle = 3 'Fixed Dialog Caption = "Properties" ClientHeight = 4965 ClientLeft = 1500 ClientTop = 1215 ClientWidth = 6225 Height = 5370 Left = 1440 LinkTopic = "Form2" MaxButton = 0 'False MinButton = 0 'False ScaleHeight = 4965 ScaleWidth = 6225 ShowInTaskbar = 0 'False Top = 870 Width = 6345 Begin VB.Frame FrameUserData Caption = "User Data" Height = 2145 Left = 2430 TabIndex = 16 Top = 2670 Width = 3615 Begin VB.TextBox Text1 Height = 555 Left = 1020 MultiLine = -1 'True ScrollBars = 2 'Vertical TabIndex = 27 Top = 300 Width = 2415 End Begin VB.TextBox Text4 Height = 315 Left = 1020 TabIndex = 22 Top = 1680 Width = 825 End Begin VB.TextBox Text3 Height = 315 Left = 1020 TabIndex = 21 Top = 1290 Width = 825 End Begin VB.TextBox Text2 Height = 285 Left = 1020 TabIndex = 17 Top = 930 Width = 2415 End Begin VB.Label Label1 Alignment = 1 'Right Justify Caption = "Text:" Height = 255 Left = 240 TabIndex = 28 Top = 300 Width = 555 End Begin VB.Label Label8 Alignment = 1 'Right Justify Caption = "Long Data:" Height = 255 Left = 120 TabIndex = 20 Top = 1710 Width = 825 End Begin VB.Label Label7 Alignment = 1 'Right Justify Caption = "Short Data:" Height = 255 Left = 120 TabIndex = 19 Top = 1350 Width = 825 End Begin VB.Label Label6 Alignment = 1 'Right Justify Caption = "Item Tag:" Height = 255 Left = 90 TabIndex = 18 Top = 960 Width = 855 End End Begin VB.CommandButton CommandForeColor Caption = "Fore Color..." Height = 375 Left = 180 TabIndex = 15 Top = 4440 Width = 1305 End Begin VB.CommandButton CommandDrawColor Caption = "Draw Color..." Height = 375 Left = 180 TabIndex = 14 Top = 4020 Width = 1305 End Begin VB.CommandButton CommandFillColor Caption = "Fill Color..." Height = 375 Left = 180 TabIndex = 13 Top = 3600 Width = 1305 End Begin VB.ComboBox ComboDrawStyle Height = 315 ItemData = "ITEMPROP.frx":0000 Left = 1590 List = "ITEMPROP.frx":0019 Style = 2 'Dropdown List TabIndex = 11 Top = 2220 Width = 2415 End Begin VB.CheckBox CheckHiding Alignment = 1 'Right Justify Caption = "Hiding Item" Height = 255 Left = 180 TabIndex = 10 Top = 3210 Width = 1635 End Begin VB.CheckBox CheckTransparent Alignment = 1 'Right Justify Caption = "Node Transparent" Height = 255 Left = 180 TabIndex = 9 Top = 2910 Width = 1635 End Begin VB.ComboBox ComboLinkHead Height = 315 ItemData = "ITEMPROP.frx":007F Left = 1590 List = "ITEMPROP.frx":009B Style = 2 'Dropdown List TabIndex = 8 Top = 1860 Width = 2415 End Begin VB.CheckBox CheckOriented Alignment = 1 'Right Justify Caption = "Link Oriented" Height = 255 Left = 180 TabIndex = 7 Top = 2610 Width = 1635 End Begin VB.ComboBox ComboAlignment Height = 315 ItemData = "ITEMPROP.frx":013F Left = 1590 List = "ITEMPROP.frx":015E Style = 2 'Dropdown List TabIndex = 4 Top = 1500 Width = 2415 End Begin VB.CommandButton Command2 Cancel = -1 'True Caption = "Cancel" Height = 435 Left = 5130 TabIndex = 3 Top = 630 Width = 915 End Begin VB.CommandButton Command1 Caption = "Ok" Default = -1 'True Height = 435 Left = 5130 TabIndex = 2 Top = 150 Width = 915 End Begin VB.ComboBox ComboShape Height = 315 ItemData = "ITEMPROP.frx":023D Left = 1590 List = "ITEMPROP.frx":025C Style = 2 'Dropdown List TabIndex = 0 Top = 1140 Width = 2415 End Begin VB.Label LabelComment BorderStyle = 1 'Fixed Single BeginProperty Font name = "MS Sans Serif" charset = 0 weight = 700 size = 8.25 underline = 0 'False italic = 0 'False strikethrough = 0 'False EndProperty Height = 795 Left = 180 TabIndex = 26 Top = 180 Width = 3855 End Begin VB.Label LabelForeColor BorderStyle = 1 'Fixed Single Height = 345 Left = 1590 TabIndex = 25 Top = 4440 Width = 345 End Begin VB.Label LabelDrawColor BorderStyle = 1 'Fixed Single Height = 345 Left = 1590 TabIndex = 24 Top = 4020 Width = 345 End Begin VB.Label LabelFillColor BorderStyle = 1 'Fixed Single Height = 345 Left = 1590 TabIndex = 23 Top = 3600 Width = 345 End Begin MSComDlg.CommonDialog CommonDialog1 Left = 4440 Top = 390 _Version = 65536 _ExtentX = 847 _ExtentY = 847 _StockProps = 0 End Begin VB.Label Label5 Caption = "DrawStyle:" Height = 255 Left = 180 TabIndex = 12 Top = 2220 Width = 1320 End Begin VB.Label Label4 Caption = "Link Arrow Head:" Height = 255 Left = 180 TabIndex = 6 Top = 1860 Width = 1320 End Begin VB.Label Label3 Caption = "Text Alignment:" Height = 255 Left = 180 TabIndex = 5 Top = 1500 Width = 1320 End Begin VB.Label Label2 Caption = "Node Shape:" Height = 255 Left = 180 TabIndex = 1 Top = 1140 Width = 1320 End Attribute VB_Name = "ItemProp" Attribute VB_Creatable = False Attribute VB_Exposed = False Option Explicit Sub SetItemProperties(Net1 As Control, item As Long) With Net1 .SetItemDrawColor item, LabelDrawColor.BackColor .SetItemForeColor item, LabelForeColor.BackColor .SetItemText item, Text1 .SetItemTag item, Text2 .SetItemShort item, Val(Text3) .SetItemLong item, Val(Text4) .SetItemDrawStyle item, ComboDrawStyle.ListIndex .SetItemHiding item, (CheckHiding.value = 1) If .IsItemLink(item) Then .SetLinkOriented item, (CheckOriented.value = 1) .SetLinkArrowHead item, ComboLinkHead.ListIndex Else .SetNodeTransparent item, (CheckTransparent.value = 1) .SetNodeShape item, ComboShape.ListIndex .SetNodeAlignment item, ComboAlignment.ListIndex .SetNodeFillColor item, LabelFillColor.BackColor End If End With End Sub Private Sub Command1_Click() With Main.Net1 If .item <> 0 Then ' There is a current item SetItemProperties Main.Net1, .item Else ' No current item .FillColor = LabelFillColor.BackColor .ForeColor = LabelForeColor.BackColor .DrawColor = LabelDrawColor.BackColor .DrawStyle = ComboDrawStyle.ListIndex .Oriented = (CheckOriented.value = 1) .LinkHead = ComboLinkHead.ListIndex .Hiding = (CheckHiding.value = 1) .Transparent = (CheckTransparent.value = 1) .Shape = ComboShape.ListIndex .Alignment = ComboAlignment.ListIndex End If End With Unload Me End Sub Private Sub Command2_Click() Unload Me End Sub Private Sub CommandDrawColor_Click() With CommonDialog1 .Color = LabelDrawColor.BackColor .Flags = cdlCCRGBInit .Action = 3 LabelDrawColor.BackColor = .Color End With End Sub Private Sub CommandFillColor_Click() With CommonDialog1 .Color = LabelFillColor.BackColor .Flags = cdlCCRGBInit .Action = 3 LabelFillColor.BackColor = .Color End With End Sub Private Sub CommandForeColor_Click() With CommonDialog1 .Color = LabelForeColor.BackColor .Flags = cdlCCRGBInit .Action = 3 LabelForeColor.BackColor = .Color End With End Sub Private Sub Form_Load() With Main.Net1 If .item = 0 Then FrameUserData.Visible = False LabelComment.Caption = "No current item: therefore property settings are persistent. Next created items will received those property values by default." Text1.Enabled = False Text2.Enabled = False Text3.Enabled = False Text4.Enabled = False If .Oriented Then CheckOriented.value = 1 Else CheckOriented.value = 0 End If ComboLinkHead.ListIndex = .LinkHead If .Transparent Then CheckTransparent.value = 1 Else CheckTransparent.value = 0 End If ComboShape.ListIndex = .Shape ComboAlignment.ListIndex = .Alignment LabelFillColor.BackColor = .FillColor If .Hiding Then CheckHiding.value = 1 Else CheckHiding.value = 0 End If ComboDrawStyle.ListIndex = .DrawStyle LabelDrawColor.BackColor = .DrawColor LabelForeColor.BackColor = .ForeColor Else If .IsLink Then LabelComment.Caption = "The current item is a link. ""Node-only"" properties are disabled. Property settings will apply only to this current link." If .Oriented Then CheckOriented.value = 1 Else CheckOriented.value = 0 End If ComboShape.Enabled = False ComboAlignment.Enabled = False ComboLinkHead.ListIndex = .LinkHead CommandFillColor.Enabled = False CheckTransparent.Enabled = False Else LabelComment.Caption = "The current item is a node. ""Link-only"" properties are disabled. Property settings will apply only to this current node." If .Transparent Then CheckTransparent.value = 1 Else CheckTransparent.value = 0 End If CheckOriented.Enabled = False ComboLinkHead.Enabled = False ComboShape.ListIndex = .Shape ComboAlignment.ListIndex = .Alignment LabelFillColor.BackColor = .FillColor End If If .Hiding Then CheckHiding.value = 1 Else CheckHiding.value = 0 End If ComboDrawStyle.ListIndex = .DrawStyle LabelDrawColor.BackColor = .DrawColor LabelForeColor.BackColor = .ForeColor Text1 = .Text Text2 = .ItemTag Text3 = Str(.Type) Text4 = Str(.Data) End If End With End Sub Private Sub OptionApply_Click(Index As Integer) End Sub